import {GET} from "@/apis";
import {BookConfig} from "@/apis/recommend";

export enum NodeNameEnum {
    LABEL = "Label",
    TYPE = "Type",
    AUTHOR = "Author"
}

/* 获取图书信息 */
export const getBookInfoById = (bookId: string) => GET<BookConfig>(`/knowledgeGraph/getBookNode?bookId=${bookId}`)

/* 随机获取指定节点 */
export const getRandomNode = (nodeName: NodeNameEnum, size:number) => GET<any[]>(`/knowledgeGraph/getNodeProperty?nodeName=${nodeName}&size=${size}`)

// export const createRelationshipToBook = (bookId: string) => PUT<BookConfig>(`/knowledgeGraph/createRelationshipToBook/${bookId}`)
